﻿
namespace SpiderMaster.AspNet
{
    public sealed partial class TradingCenter
    {
        /// <summary> This shut downs each application allowing for them to complete tasks.
        /// </summary>
        public TradingCenter Stop()
        {
            TaskScheduler.Current.StopTasks();

            if (InvokePlugins)
                foreach (IPluginManagement manager in _Instance.GetAllPluginManagers())
                    manager.UnLoad();

            return new TradingCenter(); // TODO: create TradingCenter.Empty
        }
    }
}
